<html xmlns="http://www.w3.org/1999/xhtml" lang="cn">
  <head>
    <style>
    html,body{
      font-size:12px;
      padding:0px;
      margin: 0px;
      width:100%;
      overflow: hidden;
    }
    a{
      text-decoration: none;
    }
    .head{
      height:50px;
      background: #398dee;
      position: relative;
      line-height: 50px;
    }

    .head .wrap{
      width:960px;
      margin:0px auto;
    }

    .head .wrap .head_main{
      height:50px;
      position: relative;
    }

    .head .wrap .head_main .logo{
      color:#fff;
      display: inline-block;
      position: absolute;
      margin:0px;
    }

    .head .wrap .head_main .nav{
      display: inline-block;
      right:0px;
      position: absolute;
      color:#fff;
      margin: 0px;
      padding: 0px;
    }

    .nav a{
      color:#fff;
      text-decoration: none;
      font-size:14px;
    }

    .main .text{
      padding: 5px 10px;
      line-height: 30px;
      outline: none;
      font-size: 12px;
      box-sizing: border-box;
      border: 1px solid #d6d6d6;
      border-radius: 3px;
      height: 54px;
      width: 296px;
    }

    .main .text:focus{
      background-color:#f7fafe;
    }
    .main{
      height:100%;
    }
    .main .login_wrap{
      width: 296px;
      height:336px;
      margin:100px auto;
      padding: 25px 54px;
      box-shadow: 0px 1px 16px 0 rgba(90, 109, 122, 0.41);

    }

    .main .row{
      margin-bottom: 30px;
    }

    .main .check-row{
      position: relative;
    }

    .main .row .login-type{
      cursor: pointer;
      padding-bottom: 10px;
      font-size: 18px;
      margin-bottom: 38px;
    }

    .main .row .login-type:hover,.main .row .login-type.selected{
      color: #398dee;
      border-bottom: 2px solid #398dee;
    }

    .login-label .login-checkbox {
    outline: none;
    cursor: pointer;
    position: relative;
    /* top: -1px; */
    vertical-align: middle;
  }

  .forget-password{
    position: absolute;
    right:0px;
    color:#9bc1f1;
    text-decoration: none;
  }
  .row-btn .login-btn{
  float: left;
    background-color: #398dee;
    color: #fff;
  }

  .row-btn .register-btn{
    float: left;
    margin-left: 36px;
    text-align: center;
    color: #9bc1f1;
  }
  .row-btn .btn {
    display: inline-block;
    width: 130px;
    height: 46px;
    line-height: 46px;
    border: 1px solid #398dee;
    box-sizing: border-box;
    border-radius: 3px;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
    outline: none;
  }

  .login_wrap .error{
    color:red;
  }
    </style>
    
    <script type="text/javascript" src="${request.contextPath}/static/jquery.min.3.3.1.js"></script>
    <script type="text/javascript" src="${request.contextPath}/static/jquery.form.min.js"></script>
  </head>
  <body>
    <div class="head">
      <div class="wrap">
        <div class="head_main">
          <h2 class="logo">我的笔记</h2>
          <div class="nav">
            <a href="javascript:void(0)" target="_self">首页&nbsp;</a>
            |
            <a href="" target="_self">&nbsp;多平台下载</a>
          </div>
        </div>
      </div>
    </div>

    <div class="main">
      <div class="login_wrap">
        <div class="row">
          <span class="login-type selected">账号登录</span>
        </div>
        <form id="loginForm" method="post" enctype="multipart/form-data" >
          <div class="account row">
            <input type="text" placeholder="账号" name="username" class="text"/>
          </div>

          <div class="password row">
            <input type="password" placeholder="密码" name="password" class="text"/>
          </div>

          <div class="row check-row">
            <label class="login-label">
              <input type="checkbox" class="login-checkbox"/>自动登录
            </label>

            <a href="" class="forget-password">忘记密码?</a>
            <div class="error">账号或密码错误</div>
          </div>

          <div class="row row-btn">
            <a class="login-btn btn" id="loginBtn">登录</a>

            <a href="" class="register-btn btn">注册</a>
          </div>
        </form>
      </div>
    </div>
    
  </body>
  <script type="text/javascript">
  		$("#loginBtn").on("click",function(){
  			 $('#loginForm').ajaxSubmit(      //ajax方式提交表单
  					{
  						url: 'login',
  						type: 'post',
  						dataType: 'json',
  						beforeSubmit: function () {},
  						success: function (data) {
  							if (data.code === 0) {
  								alert(data.msg)
  							} else {
  								alert(data.msg);
  							}
  						},
  						clearForm: false,//禁止清楚表单
  						resetForm: false //禁止重置表单
  					});
  		});
  </script>
</html>
